package com.zhuang.chapter11.work04;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class StirngToDate {

	public static void main(String[] args) throws ParseException {
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入你的出生年月:");
		String birthDate = sc.next();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		Date d = sdf.parse(birthDate);
		System.out.println("你的出生年月为:" + new SimpleDateFormat("yyyy年MM月dd日").format(d));
		sc.close();
	}
}
